import Vue from 'vue'
import VueRouter from "vue-router";

// ! 一级路由
import Layout from '@/views/Layout'
import Detail from '@/views/Detail'

// ! 二级路由
import Index from '@/views/Index'
import FindHome from '@/views/FindHome'
import Consult from '@/views/Consult'
import User from '@/views/User'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path:'/',
      component:Layout,
      redirect:'/index',
      children:[
        {
          path:'/index',
          component:Index,
         
        },
        {
          path:'/findhome',
          component:FindHome
        },
        {
          path:'/consult',
          component:Consult
        },
        {
          path:'/user',
          component:User
        },
      ]
    },
    {
      path:'/detail/:id',
      component:Detail
    }
  ],
  linkActiveClass:'active'
})

export default router